package com.aizhixin.lab.project.template.repository;

import com.aizhixin.lab.project.template.entity.Project;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

public interface ProjectRepository extends JpaRepository<Project,String> {
    Page<Project> findByDeleteFlagAndCreatedBy(Pageable page,Integer deleteFlag,Long createdBy);
    Page<Project> findByIsPublishAndDeleteFlagAndCreatedBy(Pageable page, Integer isPublish,Integer deleteFlag,Long createdBy);
    Page<Project> findByIsPublishAndProjectNameIsLikeAndDeleteFlagAndCreatedBy(Pageable page,Integer isPublish,String projectName,Integer deleteFlag,Long createdBy);
    Page<Project> findByIsPublishAndProjectTypeAndDeleteFlagAndCreatedBy(Pageable page,Integer isPublish,String projectType,Integer deleteFlag,Long createdBy);
    Page<Project> findByProjectTypeAndDeleteFlagAndCreatedBy(Pageable page,String projectType,Integer deleteFlag,Long createdBy);
    Page<Project> findByProjectTypeAndProjectNameIsLikeAndDeleteFlagAndCreatedBy(Pageable page,String projectType,String projectName,Integer deleteFlag,Long createdBy);
    Page<Project> findByProjectNameIsLikeAndDeleteFlagAndCreatedBy(Pageable page,String projectName,Integer deleteFlag,Long createdBy);
    Page<Project> findByIsPublishAndProjectTypeAndProjectNameIsLikeAndDeleteFlagAndCreatedBy(Pageable page,Integer isPublish,String projectType,String projectName,Integer deleteFlag,Long createdBy);


    Page<Project> findByDeleteFlag(Pageable page,Integer deleteFlag);
    Page<Project> findByIsPublishAndDeleteFlag(Pageable page, Integer isPublish,Integer deleteFlag);
    Page<Project> findByIsPublishAndProjectNameIsLikeAndDeleteFlag(Pageable page,Integer isPublish,String projectName,Integer deleteFlag);
    Page<Project> findByIsPublishAndProjectTypeAndDeleteFlag(Pageable page,Integer isPublish,String projectType,Integer deleteFlag);
    Page<Project> findByProjectTypeAndDeleteFlag(Pageable page,String projectType,Integer deleteFlag);
    Page<Project> findByProjectTypeAndProjectNameIsLikeAndDeleteFlag(Pageable page,String projectType,String projectName,Integer deleteFlag);
    Page<Project> findByProjectNameIsLikeAndDeleteFlag(Pageable page,String projectName,Integer deleteFlag);
    Page<Project> findByIsPublishAndProjectTypeAndProjectNameIsLikeAndDeleteFlag(Pageable page,Integer isPublish,String projectType,String projectName,Integer deleteFlag);
}
